package dianmobile.eistarandroid.beans;

/**
 * 记录账号、密码，用于账号管理
 * Created by dianmobile_yy on 15/11/24.
 */
public class AccountEntity {
    private String account;
    private String password;
    private boolean isLogin;    //当前登录的是否为该账号
    private boolean isEdit = false;     //是否处于编辑状态

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public boolean isLogin() {
        return isLogin;
    }

    public void setIsLogin(boolean isLogin) {
        this.isLogin = isLogin;
    }

    public boolean isEdit() {
        return isEdit;
    }

    public void setIsEdit(boolean isEdit) {
        this.isEdit = isEdit;
    }

    /**
     *
     * @param o 待比较对象
     * @return 如果两个对象的account相等就返回true
     */
    @Override
    public boolean equals(Object o) {
        if (o == this) {
            return true;
        }
        if ( o instanceof AccountEntity) {
            if (((AccountEntity) o).getAccount().equals(this.getAccount())) {
                return true;
            }
        }
        return false;
    }
}
